<!--
    Document   : Friends List View
    Created on : 28/11/2010, 02:40:58 PM
    Author     :  Ing. Javier Silva Perez
-->

<ice:panelGroup xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:ice="http://www.icesoft.com/icefaces/component"
	xmlns:f="http://java.sun.com/jsf/core" styleClass="textoFormulario">
	<center>
		<ice:outputText value="#{msgs['page.PendingRequestsView.Title']}"
			styleClass="tituloPag" />
	</center>

	<ice:panelGroup styleClass="exampleBox"
		style="float:left;width:600px; margin-top: 10px">
		<!-- Tabla que contendra la informacion -->
		<ice:dataTable id="result_PendingRequests" var="solicitud"
			value="#{pendingRequestsViewBean.solicitudesPendientes}" rows="10"
			scrollable="false" scrollHeight="250px"
			style="float:left;margin-left: 30px" columnWidths="50px,350px"
			styleClass="dataPaginatorDataTable" cellpadding="0"
			sortColumn="#{pendingRequestsViewBean.sortColumnName}"
			sortAscending="#{pendingRequestsViewBean.ascending}">

			<ice:column>
				<ice:rowSelector id="selected"
							value="#{solicitud.selected}"
                            multiple="false"
                            preStyleOnSelection="true"
                            selectionListener="#{pendingRequestsViewBean.rowSelectionListener}"
                            immediate="false"/> 					
				<f:facet name="header">
					<ice:commandSortHeader id="IDHeader" columnName="idSort">
						<ice:outputText id="iDColumn"
							value="#{msgs['page.PendingRequestsView.IDColumn.header']}" />
					</ice:commandSortHeader>
				</f:facet>
				<ice:outputText id="idSolicitud_PendingRequests"
					value="#{solicitud.id}" />
			</ice:column>

			<ice:column>
				<f:facet name="header">
					<ice:commandSortHeader id="solicitanteHeader"
						columnName="nombreSort">
						<ice:outputText id="solicitanteColumn"
							value="#{msgs['page.PendingRequestsView.solicitanteColumn.header']}" />
					</ice:commandSortHeader>
				</f:facet>
				<ice:outputText id="nombrePersona"
					value="#{solicitud.solicitante.nombreCompleto}"
					styleClass="friendResult" />
				<ice:graphicImage value="#{solicitud.solicitante.fotografia}" width="60"
					height="90" style="float:right" styleClass="exampleBox" rendered="#{!empty solicitud.solicitante.fotografia}"/>

			</ice:column>

			<ice:column>
				<f:facet name="header">
					<ice:commandSortHeader id="fechaHeader" columnName="fechaSort">
						<ice:outputText id="fechaColumn"
							value="#{msgs['page.PendingRequestsView.fechaColumn.header']}" />
					</ice:commandSortHeader>
				</f:facet>
				<ice:outputText id="txtfecha_Pending"
					value="#{solicitud.fechaSolicitud}" />

			</ice:column>

		</ice:dataTable>
		<ice:panelGroup styleClass="clearer" />

		<!-- Panel que contendra los botones para explorar la tabla,
                - fastStep : Cuantas paginas avanzara o retrocedera
                - paginatorMaxPages: No. de links directos a paginas
        -->
		<ice:panelGroup style="float:left;width:600px;">
			<center>
				<ice:dataPaginator id="dataPaginator_1" for="result_PendingRequests"
					fastStep="3" paginator="true" paginatorMaxPages="4">
					<f:facet name="first">
						<ice:graphicImage id="firstpage_1"
							url="/resources/images/arrows/PaginationArrowFirst.png"
							style="border:none;" title="#{msgs['page.Paginator.first']}" />
					</f:facet>
					<f:facet name="last">
						<ice:graphicImage id="lastpage_1"
							url="/resources/images/arrows/PaginationArrowLast.png"
							style="border:none;" title="#{msgs['page.Paginator.last']}" />
					</f:facet>
					<f:facet name="previous">
						<ice:graphicImage id="previouspage_1"
							url="/resources/images/arrows/PaginationArrowPrev.png"
							style="border:none;" title="#{msgs['page.Paginator.previous']}" />
					</f:facet>
					<f:facet name="next">
						<ice:graphicImage id="nextpage_1"
							url="/resources/images/arrows/PaginationArrowNext.png"
							style="border:none;" title="#{msgs['page.Paginator.first']}" />
					</f:facet>
					<f:facet name="fastforward">
						<ice:graphicImage id="fastforward_1"
							url="/resources/images/arrows/PaginationArrowFastNext.png"
							style="border:none;" title="#{msgs['page.Paginator.fastFoward']}" />
					</f:facet>
					<f:facet name="fastrewind">
						<ice:graphicImage id="fastrewind_1"
							url="/resources/images/arrows/PaginationArrowFastPrev.png"
							style="border:none;"
							title="#{msgs['page.Paginator.fastPrevios']}" />
					</f:facet>
				</ice:dataPaginator>
			</center>
		</ice:panelGroup>
		<center>
			<ice:outputText value="#{pendingRequestsViewBean.errorMsg}"
				styleClass="errorMsg" />
		</center>
	</ice:panelGroup>

	<ice:panelGroup style="float:left;width:600px; margin-top: 20px">
		<center>
			<ice:commandButton
				panelConfirmation="#{pendingRequestsViewBean.withConfirmation ? 'acceptConfirmPanel' : null}"
				id="btnAceptar_PendingRequests"
				image="/resources/images/buttons/btnAceptar.png" value="Aceptar"
				action="#{pendingRequestsViewBean.aceptarSolicitudes}" />			
				
			<ice:commandButton
				panelConfirmation="#{pendingRequestsViewBean.withConfirmation ? 'rejectConfirmPanel' : null}"
				id="btnRechazar_PendingRequests"
				image="/resources/images/buttons/btnRechazar.png" value="Rechazar"
				action="#{pendingRequestsViewBean.rechazarSolicitudes}" />
			
			<br />
			<ice:message style="color: red;" id="btnAceptarError_msg"
				for="btnAceptar_PendingRequests" />			
				
		</center>				
		
	</ice:panelGroup>

	<ice:panelConfirmation id="acceptConfirmPanel"
		message="#{msgs['page.PendingRequestsView.confirmationPanel.message']}"
		acceptLabel="#{msgs['page.PendingRequestsView.confirmationPanel.acceptLabel']}"
		rendered="#{pendingRequestsViewBean.withConfirmation}" />
		
	<ice:panelConfirmation id="rejectConfirmPanel"
		message="#{msgs['page.PendingRequestsView.confirmationPanel.reject.message']}"
		acceptLabel="#{msgs['page.PendingRequestsView.confirmationPanel.rejectLabel']}"
		rendered="#{pendingRequestsViewBean.withConfirmation}" />
</ice:panelGroup>


